Skip to content

Implement global package search for build chroot results#4154

Open
sundaram123krishnan wants to merge 1 commit intofedora-copr:mainfrom
sundaram123krishnan:package-search-form
Open

Implement global package search for build chroot results#4154
sundaram123krishnan wants to merge 1 commit intofedora-copr:mainfrom
sundaram123krishnan:package-search-form

Conversation

@sundaram123krishnan
Copy link
Contributor

Fixes #1947

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a global package search feature, which is a valuable addition. The implementation is well-structured, including a new form, view, logic, template, and tests. I've identified a couple of areas for improvement in the view logic and form validation that would enhance maintainability and performance. My suggestions focus on refactoring repetitive code and optimizing a database query.

Comment on lines +1780 to +1791
has_value = any([
self.name.data,
self.version.data,
self.release.data,
self.arch.data,
self.epoch.data is not None,
])
if not has_value:
self.name.errors.append("At least one search field must be provided")
return False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic to check if at least one field has a value is duplicated here and in the search_params method. You can simplify this by calling self.search_params() and checking if the resulting dictionary is empty. This avoids code duplication and makes the validation more maintainable.

        if not self.search_params():
            self.name.errors.append("At least one search field must be provided")
            return False

@sundaram123krishnan sundaram123krishnan force-pushed the package-search-form branch 2 times, most recently from 30faadf to 65d3c33 Compare February 4, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search package name/version/release

1 participant